3.1.45 \(\int \cos ^5(c+d x) (B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\) [45]

Optimal. Leaf size=76 \[ \frac {3 B x}{8}+\frac {C \sin (c+d x)}{d}+\frac {3 B \cos (c+d x) \sin (c+d x)}{8 d}+\frac {B \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {C \sin ^3(c+d x)}{3 d} \]

[Out]

3/8*B*x+C*sin(d*x+c)/d+3/8*B*cos(d*x+c)*sin(d*x+c)/d+1/4*B*cos(d*x+c)^3*sin(d*x+c)/d-1/3*C*sin(d*x+c)^3/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {4132, 2715, 8, 12, 2713} \begin {gather*} \frac {B \sin (c+d x) \cos ^3(c+d x)}{4 d}+\frac {3 B \sin (c+d x) \cos (c+d x)}{8 d}+\frac {3 B x}{8}-\frac {C \sin ^3(c+d x)}{3 d}+\frac {C \sin (c+d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^5*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

(3*B*x)/8 + (C*Sin[c + d*x])/d + (3*B*Cos[c + d*x]*Sin[c + d*x])/(8*d) + (B*Cos[c + d*x]^3*Sin[c + d*x])/(4*d)
 - (C*Sin[c + d*x]^3)/(3*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2713

Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[Expand[(1 - x^2)^((n - 1)/2), x], x], x
, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[(n - 1)/2, 0]

Rule 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

Rule 4132

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(
C_.)), x_Symbol] :> Dist[B/b, Int[(b*Csc[e + f*x])^(m + 1), x], x] + Int[(b*Csc[e + f*x])^m*(A + C*Csc[e + f*x
]^2), x] /; FreeQ[{b, e, f, A, B, C, m}, x]

Rubi steps

\begin {align*} \int \cos ^5(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=B \int \cos ^4(c+d x) \, dx+\int C \cos ^3(c+d x) \, dx\\ &=\frac {B \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {1}{4} (3 B) \int \cos ^2(c+d x) \, dx+C \int \cos ^3(c+d x) \, dx\\ &=\frac {3 B \cos (c+d x) \sin (c+d x)}{8 d}+\frac {B \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {1}{8} (3 B) \int 1 \, dx-\frac {C \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{d}\\ &=\frac {3 B x}{8}+\frac {C \sin (c+d x)}{d}+\frac {3 B \cos (c+d x) \sin (c+d x)}{8 d}+\frac {B \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {C \sin ^3(c+d x)}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.09, size = 73, normalized size = 0.96 \begin {gather*} \frac {3 B (c+d x)}{8 d}+\frac {C \sin (c+d x)}{d}-\frac {C \sin ^3(c+d x)}{3 d}+\frac {B \sin (2 (c+d x))}{4 d}+\frac {B \sin (4 (c+d x))}{32 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^5*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

(3*B*(c + d*x))/(8*d) + (C*Sin[c + d*x])/d - (C*Sin[c + d*x]^3)/(3*d) + (B*Sin[2*(c + d*x)])/(4*d) + (B*Sin[4*
(c + d*x)])/(32*d)

________________________________________________________________________________________

Maple [A]
time = 0.57, size = 60, normalized size = 0.79

method result size
derivativedivides \(\frac {B \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {C \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}}{d}\) \(60\)
default \(\frac {B \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {C \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}}{d}\) \(60\)
risch \(\frac {3 B x}{8}+\frac {3 C \sin \left (d x +c \right )}{4 d}+\frac {B \sin \left (4 d x +4 c \right )}{32 d}+\frac {C \sin \left (3 d x +3 c \right )}{12 d}+\frac {B \sin \left (2 d x +2 c \right )}{4 d}\) \(63\)
norman \(\frac {-\frac {3 B x}{8}-\frac {3 B x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-\frac {15 B x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {15 B x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {3 B x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {3 B x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {\left (3 B -8 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {\left (3 B +8 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}-\frac {\left (5 B -8 C \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {\left (5 B +8 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (9 B -40 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {\left (9 B +40 C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) \(248\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^5*(B*sec(d*x+c)+C*sec(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(B*(1/4*(cos(d*x+c)^3+3/2*cos(d*x+c))*sin(d*x+c)+3/8*d*x+3/8*c)+1/3*C*(2+cos(d*x+c)^2)*sin(d*x+c))

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 57, normalized size = 0.75 \begin {gather*} \frac {3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} B - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C}{96 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^5*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="maxima")

[Out]

1/96*(3*(12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c))*B - 32*(sin(d*x + c)^3 - 3*sin(d*x + c))*C)/d

________________________________________________________________________________________

Fricas [A]
time = 2.43, size = 53, normalized size = 0.70 \begin {gather*} \frac {9 \, B d x + {\left (6 \, B \cos \left (d x + c\right )^{3} + 8 \, C \cos \left (d x + c\right )^{2} + 9 \, B \cos \left (d x + c\right ) + 16 \, C\right )} \sin \left (d x + c\right )}{24 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^5*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="fricas")

[Out]

1/24*(9*B*d*x + (6*B*cos(d*x + c)^3 + 8*C*cos(d*x + c)^2 + 9*B*cos(d*x + c) + 16*C)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (B + C \sec {\left (c + d x \right )}\right ) \cos ^{5}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**5*(B*sec(d*x+c)+C*sec(d*x+c)**2),x)

[Out]

Integral((B + C*sec(c + d*x))*cos(c + d*x)**5*sec(c + d*x), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 140 vs. \(2 (68) = 136\).
time = 0.45, size = 140, normalized size = 1.84 \begin {gather*} \frac {9 \, {\left (d x + c\right )} B - \frac {2 \, {\left (15 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 9 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 9 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 15 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4}}}{24 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^5*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="giac")

[Out]

1/24*(9*(d*x + c)*B - 2*(15*B*tan(1/2*d*x + 1/2*c)^7 - 24*C*tan(1/2*d*x + 1/2*c)^7 - 9*B*tan(1/2*d*x + 1/2*c)^
5 - 40*C*tan(1/2*d*x + 1/2*c)^5 + 9*B*tan(1/2*d*x + 1/2*c)^3 - 40*C*tan(1/2*d*x + 1/2*c)^3 - 15*B*tan(1/2*d*x
+ 1/2*c) - 24*C*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 + 1)^4)/d

________________________________________________________________________________________

Mupad [B]
time = 2.50, size = 75, normalized size = 0.99 \begin {gather*} \frac {3\,B\,x}{8}+\frac {2\,C\,\sin \left (c+d\,x\right )}{3\,d}+\frac {3\,B\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{8\,d}+\frac {B\,{\cos \left (c+d\,x\right )}^3\,\sin \left (c+d\,x\right )}{4\,d}+\frac {C\,{\cos \left (c+d\,x\right )}^2\,\sin \left (c+d\,x\right )}{3\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^5*(B/cos(c + d*x) + C/cos(c + d*x)^2),x)

[Out]

(3*B*x)/8 + (2*C*sin(c + d*x))/(3*d) + (3*B*cos(c + d*x)*sin(c + d*x))/(8*d) + (B*cos(c + d*x)^3*sin(c + d*x))
/(4*d) + (C*cos(c + d*x)^2*sin(c + d*x))/(3*d)

________________________________________________________________________________________